import django.forms as forms
from instafeed.conduits.models import Conduit, get_conduit_plugins
from instafeed.utils import CustomAsUlFormMixin

class ConduitForm(CustomAsUlFormMixin, forms.ModelForm):
    plugin = forms.ChoiceField(
        choices=[(p.key, p.name) for p in get_conduit_plugins()
                 if p.allowNew]
        )

    class Meta:
        model = Conduit
        fields = ('name', 'plugin')

